<template>
  <div class="app-container">
    <div class="flex ai-c">
      <div class="logo">{{ info.COMPANY_NM ? info.COMPANY_NM.substring(0, 1) : '' }}</div>
      <div class="flex vertical">
        <span class="name">{{ info.COMPANY_NM }}</span>
        <span class="code">{{ info.ORGNUM }}</span>
      </div>
    </div>
    <div class="mt10">
      <el-tag
        v-for="item in busiType.split(',')"
        :key="item"
        :type="getDictClass('sys_business_type', item)"
        size="mini"
        class="busi-tag"
      >{{ dict.label.sys_business_type[item] }}</el-tag>
    </div>
    <div class="mt20">
      <div class="row">
        <span class="label">经营地址：</span><span class="value">{{ info.OFFICE_ADDR }}</span>
      </div>
      <div class="row">
        <span class="label">企业性质：</span><span class="value">{{ info.ORIG_ORG_FORM }}</span>
      </div>
      <div class="row">
        <span class="label">法定代表人：</span><span class="value">{{ info.LEG_REPRESENT }}</span>
        <el-divider direction="vertical" />
        <span class="label">主营业务：</span><span class="value">{{ info.MAIN_BUSIN }}</span>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'TopCard',
  dicts: ['sys_business_type'],
  props: {
    info: {
      type: Object,
      default: () => ({})
    }
  },
  computed: {
    busiType() {
      return this.$route.params.busiType || ''
    }
  }
}
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/variables.scss";

.logo {
  color: #fff;
  font-size: 28px;
  font-weight: 500;
  padding: 5px 10px;
  background-color: $warning-color;
  border-radius: 3px;
  margin-right: 10px;
}
.name {
  color: $label-color;
  font-size: 18px;
  font-weight: 600;
}
.code {
  color: $text-color-light;
  font-size: 13px;
  margin-top: 5px;
}
.busi-tag + .busi-tag {
  margin-left: 5px;
}

.row {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.label {
  color: $text-color-light;
  line-height: 24px;
}
.value {
  line-height: 24px;
}
::v-deep .el-divider {
  margin: 0 20px;
}
</style>
